package com.framework.admin.repository;

import com.framework.admin.model.ModuleFormField;
import com.framework.common.repository.BaseJpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * @description: 模块表单字段 Repository
 * @author: lizurong
 * @version: 1.0
 * @date: 2021-03-08 13:21:06
 */

@Repository
public interface ModuleFormFieldRepository extends BaseJpaRepository<ModuleFormField, String> {

    @Query("select  t from ModuleFormField t where t.moduleFormId=:moduleFormId order by t.listSort")
    List<ModuleFormField> getByModuleFormId(@Param("moduleFormId") String moduleFormId);

    @Query("select  t from ModuleFormField t where t.moduleFormId=:moduleFormId and t.listShow=1 order by t.listSort")
    List<ModuleFormField> getListFormByModuleFormId(@Param("moduleFormId") String moduleFormId);

    @Query("select  t from ModuleFormField t where t.moduleFormId=:moduleFormId and t.formShow=1 ")
    List<ModuleFormField> getFormByModuleFormId(@Param("moduleFormId") String moduleFormId);

}
